package com.itlong.cloud.property.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * <desc>
 *      物业-智慧停车-停车场出入记录访问数据库接口.
 * </desc>
 *
 * @createDate 2018/11/5
 */
@Mapper
@Repository
public interface IParkingPassRecordDao {
    /**
     * <desc>
     *      保存入场记录
     * </desc>
     *
     * @param params
     * @return
     * @author Jiaqi.X
     * @createDate 2018/11/08
     */
    Integer save(Map<String, Object> params);

    /**
     * <desc>
     *      保存入场记录
     * </desc>
     *
     * @param params
     * @return
     * @author Jiaqi.X
     * @createDate 2018/11/08
     */
    Integer update(Map<String, Object> params);

    /**
     * <desc>
     *      通过parkingId及parkId获取出入记录逻辑id
     * </desc>
     *
     * @param parkingId
     * @param parkId
     * @return
     * @author Jiaqi.X
     * @createDate 2018/11/08
     */
    String getParkPassIdByParkingIdAndParkId(@Param("parkingId") String parkingId, @Param("parkId") String parkId);

    /**
     * <desc>
     *      根据key 获取projectId
     * </desc>
     *
     * @param key
     * @return
     * @author Jiaqi.X
     * @createDate 2018/11/13
     */
    String getProjectIdByKey(@Param("key") String key);

    /**
     * <desc>
     *      判断车辆是否是月卡用户
     * </desc>
     *
     * @param projectId 项目编号
     * @param plateNumber 车牌
     * @return
     * @author Qiang.S
     * @createDate 2018/11/14
     */
    Integer getCarMonthCardInfoByPlateNumber(@Param("projectId") String projectId, @Param("plateNumber") String plateNumber);

    /**
     * <desc>
     *      删除入场重复车辆
     * </desc>
     * @param projectId
     * @param plateNumber
     * @return
     */
    Integer deleteReportCar(@Param("projectId") String projectId, @Param("plateNumber") String plateNumber);
}
